<?php
header('Content-type:text/html;charset=utf-8');

//包含数据库配置
include '../../public/peizhi.php';

//包含函数
include '../../public/func.php';

//接值表单
$title = $_POST['title'];
$miaoshu = $_POST['miaoshu'];
$url = $_POST['url'];

//调用函数连接数据库
$link = db();

//准备SQL语句
$sql = "insert into link(title,miaoshu,url) values('{$title}','{$miaoshu}','{$url}')";

//执行SQL语句
if(mysqli_query($link,$sql)){
	echo '<script>alert("添加友情链接成功");window.location.href="show.php";</script>';
}else{
	echo '<script>alert("添加友情链接失败");window.location.href="add.php";</script>';
}

//关闭数据库连接
mysqli_close($link);



